﻿// ----------------------------------------------------------------------
// <author name="Moses Kehengu"/>
// <copyright file="Report.cs" company="Futures Group International">
//     Copyright statement. All right reserved
// </copyright>
//
// ------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;
using GenericTools;
using System.Data.Common;
using DataModels.Enumerations;

namespace ReportingManagement
{
    public partial class Report : Form
    {
        #region Class Variables
        private ReportTypes type;
        private ReportLevel level;
        private string code;
        private DateTime startTime;
        private DateTime endTime;
        #endregion

        public Report(ReportTypes type, ReportLevel level, string code, DateTime startTime, DateTime endTime)
        {
            InitializeComponent();
            this.type = type;
            this.level = level;
            this.code = code;
            this.startTime = startTime;
            this.endTime = endTime;
            this.reportViewer.LocalReport.DataSources.Clear();
            string reportFile = String.Empty;

            switch (this.type)
            {
                case ReportTypes.MONTHLY_SUMMARY_FORM:
                    if (this.level == ReportLevel.FACILITY)
                        reportFile = "ReportingManagement.Reports.MonthlySummaryForm.rdlc";
                    else
                        reportFile = "ReportingManagement.Reports.AggregateSummaryForm.rdlc";
                    this.reportViewer.LocalReport.ReportEmbeddedResource = reportFile;
                    break;

                case ReportTypes.DONOR_REPORT:
                    reportFile = "ReportingManagement.Reports.DonorReport.rdlc";
                    this.reportViewer.LocalReport.ReportEmbeddedResource = reportFile;
                    LocalReport localReport = this.reportViewer.LocalReport;

                    int ID = int.Parse(code);
                    PrepareDonorReport(localReport, level, ID, startTime, endTime);

                    string[] entities = new string[3];
                    string reportName = "PMTCT TRACK 1 REPORT";
                    if (level == ReportLevel.NATION)
                    {
                        entities[0] = "All Regions";
                        entities[1] = "All Districts";
                        entities[2] = "All Facilities";
                        this.Text = String.Format("{0} : {1}", reportName, entities[0]);
                    }
                    if (level == ReportLevel.REGION)
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        entities[0] = Utilities.GetRegionName(ID);
                        Cursor.Current = Cursors.Default;
                        
                        entities[1] = "All Districts";
                        entities[2] = "All Facilities";
                        this.Text = String.Format("{0} : {1} in  {2}", reportName, entities[1], entities[0]);
                    }
                    if (level == ReportLevel.DISTRICT)
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        entities[0] = Utilities.GetRegionNameFromDistrict(ID);
                        entities[1] = Utilities.GetDistrictName(ID);
                        Cursor.Current = Cursors.Default;

                        entities[2] = "All Facilities";
                        this.Text = String.Format("{0} : {1} in {2} [{3}]", reportName, entities[2], entities[1], entities[0]);
                    }
                    break;
            }
            
        }

        private void Report_Load(object sender, EventArgs e)
        {
            this.reportViewer.SetDisplayMode(DisplayMode.PrintLayout);
            this.reportViewer.ZoomMode = ZoomMode.PageWidth;
            this.reportViewer.RefreshReport();
        }

        public void SetDataSet(DataSet dataSet)
        {
            switch (type)
            {
                case ReportTypes.MONTHLY_SUMMARY_FORM:
                    DataTable dataTable = dataSet.Tables[0];
                    Reports.ReportDataDataTable reportDataTable = new Reports.ReportDataDataTable();
                    foreach (DataRow row in dataTable.Rows)
                    {
                        DataRow r = reportDataTable.NewRow();
                        r[0] = row[0];
                        r[1] = row[1];
                        reportDataTable.Rows.Add(r);
                    }
                    ReportDataSource dataSource = new ReportDataSource("Reports");
                    dataSource.Value = reportDataTable;
                    this.reportViewer.LocalReport.DataSources.Add(dataSource);
                    break;
            }
        }

        public void SetParameters(ReportParameter[] parameters)
        {
            this.reportViewer.LocalReport.SetParameters(parameters);
        }

        #region Donor Report Static Methods
        static public void PrepareDonorReport(LocalReport report, ReportLevel level, int ID, DateTime startingDateTime, DateTime endingDateTime)
        {
            report.DataSources.Clear();
            Reports.PMTCTIndicatorDataTable PMTCTIndicatorDataTable = new Reports.PMTCTIndicatorDataTable();
            Reports.HIVExposedIndicatorDataTable HIVExposedIndicatorDataTable = new Reports.HIVExposedIndicatorDataTable();

            DataSet dataSet = null;
            string[] entities = new string[3];
            if (level == ReportLevel.NATION )
            {
                entities[0] = "All Regions";
                entities[1] = "All Districts";
                entities[2] = "All Facilities";
                dataSet = GetDataSetByNation(startingDateTime, endingDateTime);
            }
            if (level == ReportLevel.REGION)
            {
                Cursor.Current = Cursors.WaitCursor;
                entities[0] = Utilities.GetRegionName(ID);
                Cursor.Current = Cursors.Default;

                entities[1] = "All Districts";
                entities[2] = "All Facilities";
                dataSet = GetDataSetByRegion(ID, startingDateTime, endingDateTime);
            }
            if (level == ReportLevel.DISTRICT)
            {
                Cursor.Current = Cursors.WaitCursor;
                entities[0] = Utilities.GetRegionNameFromDistrict(ID);
                entities[1] = Utilities.GetDistrictName(ID);
                Cursor.Current = Cursors.Default;

                entities[2] = "All Facilities";
                dataSet = GetDataSetByDistrict(ID, startingDateTime, endingDateTime);
            }

            FillDonorReportPMTCTIndicatorTable(PMTCTIndicatorDataTable, dataSet);
            FillDonorReportHIVExposedIndicator(HIVExposedIndicatorDataTable, dataSet);

            ReportDataSource reportDataSource = new ReportDataSource("PMTCTIndicator");
            reportDataSource.Value = PMTCTIndicatorDataTable;
            report.DataSources.Add(reportDataSource);

            reportDataSource = new ReportDataSource("HIVExposedIndicator");
            reportDataSource.Value = HIVExposedIndicatorDataTable;
            report.DataSources.Add(reportDataSource);

            ReportParameter parameter = null;

            #region Header Parameters
            parameter = new ReportParameter("StartingTime", startingDateTime.ToShortDateString());
            report.SetParameters(parameter);
            parameter = new ReportParameter("EndingTime", endingDateTime.ToShortDateString());
            report.SetParameters(parameter);
            parameter = new ReportParameter("Grantee", "AIDS Relief");
            report.SetParameters(parameter);
            parameter = new ReportParameter("Region", entities[0]);
            report.SetParameters(parameter);
            parameter = new ReportParameter("District", entities[1]);
            report.SetParameters(parameter);
            parameter = new ReportParameter("Facility", entities[2]);
            report.SetParameters(parameter);
            #endregion
        }

        static private DataSet GetDataSetByNation(DateTime startingDateTime, DateTime endingDateTime)
        {
            DataSet dataSet = new DataSet();
            DataTable dataTable = null;
            //ReportLevel level = ReportLevel.NATION;

            Cursor.Current = Cursors.WaitCursor;
            //dataTable = Utilities.GetReportDataTable(level, null, DonorReportParts.ANC, startingDateTime, endingDateTime);
            dataTable = Utilities.GetNationReport(Utilities.ANC_ID, startingDateTime.Year, 
                startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "ANC";
            dataSet.Tables.Add(dataTable);

            dataTable = Utilities.GetNationReport(Utilities.PCR_ID, startingDateTime.Year,
                startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "PCR";
            dataSet.Tables.Add(dataTable);

            //dataTable = Utilities.GetReportDataTable(level, null, DonorReportParts.MAT, startingDateTime, endingDateTime);
            dataTable = Utilities.GetNationReport(Utilities.MAT_ID, startingDateTime.Year,
                startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "MAT";
            dataSet.Tables.Add(dataTable);

            //dataTable = Utilities.GetReportDataTable(level, null, DonorReportParts.MC, startingDateTime, endingDateTime);
            dataTable = Utilities.GetNationReport(Utilities.MC_ID, startingDateTime.Year,
                startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "MC";
            dataSet.Tables.Add(dataTable);
            Cursor.Current = Cursors.Default;

            return dataSet;
        }

        static private DataSet GetDataSetByRegion(int regionID, DateTime startingDateTime, DateTime endingDateTime)
        {
            DataSet dataSet = new DataSet();
            DataTable dataTable = null;
            //ReportLevel level = ReportLevel.REGION;

            Cursor.Current = Cursors.WaitCursor;
            //dataTable = Utilities.GetReportDataTable(level, regionID, DonorReportParts.ANC, startingDateTime, endingDateTime);
            dataTable = Utilities.GetRegionReport(regionID, Utilities.ANC_ID,
                startingDateTime.Year, startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "ANC";
            dataSet.Tables.Add(dataTable);

            dataTable = Utilities.GetRegionReport(regionID, Utilities.PCR_ID, startingDateTime.Year, 
                startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "PCR";
            dataSet.Tables.Add(dataTable);

            //dataTable = Utilities.GetReportDataTable(level, regionID, DonorReportParts.MAT, startingDateTime, endingDateTime);
            dataTable = Utilities.GetRegionReport(regionID, Utilities.MAT_ID,
                startingDateTime.Year, startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "MAT";
            dataSet.Tables.Add(dataTable);

            //dataTable = Utilities.GetReportDataTable(level, regionID, DonorReportParts.MC, startingDateTime, endingDateTime);
            dataTable = Utilities.GetRegionReport(regionID, Utilities.MC_ID,
                startingDateTime.Year, startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "MC";
            dataSet.Tables.Add(dataTable);
            Cursor.Current = Cursors.Default;

            return dataSet;
        }

        static private DataSet GetDataSetByDistrict(int districtID, DateTime startingDateTime, DateTime endingDateTime)
        {
            DataSet dataSet = new DataSet();
            DataTable dataTable = null;
            //ReportLevel level = ReportLevel.DISTRICT;

            Cursor.Current = Cursors.WaitCursor;
            //dataTable = Utilities.GetReportDataTable(level, districtID, DonorReportParts.ANC, startingDateTime, endingDateTime);
            dataTable = Utilities.GetDistrictReport(districtID, Utilities.ANC_ID, 
                startingDateTime.Year, startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "ANC";
            dataSet.Tables.Add(dataTable);

            dataTable = Utilities.GetDistrictReport(districtID, Utilities.PCR_ID,
                startingDateTime.Year, startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "PCR";
            dataSet.Tables.Add(dataTable);

            //dataTable = Utilities.GetReportDataTable(level, districtID, DonorReportParts.MAT, startingDateTime, endingDateTime);
            dataTable = Utilities.GetDistrictReport(districtID, Utilities.MAT_ID,
                startingDateTime.Year, startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "MAT";
            dataSet.Tables.Add(dataTable);

            //dataTable = Utilities.GetReportDataTable(level, districtID, DonorReportParts.MC, startingDateTime, endingDateTime);
            dataTable = Utilities.GetDistrictReport(districtID, Utilities.MC_ID,
                startingDateTime.Year, startingDateTime.Month, endingDateTime.Year, endingDateTime.Month);
            dataTable.TableName = "MC";
            dataSet.Tables.Add(dataTable);
            Cursor.Current = Cursors.Default;

            return dataSet;
        }

        private static void SetParameters(LocalReport report, string[] entities, DateTime startingDateTime, DateTime endingDateTime, DataSet dataSet)
        {
            ReportParameter parameter = null;

            #region Header Parameters
            parameter = new ReportParameter("StartingTime", startingDateTime.ToShortDateString());
            report.SetParameters(parameter);
            parameter = new ReportParameter("EndingTime", endingDateTime.ToShortDateString());
            report.SetParameters(parameter);
            parameter = new ReportParameter("Grantee", "AIDS Relief");
            report.SetParameters(parameter);
            parameter = new ReportParameter("Region", entities[0]);
            report.SetParameters(parameter);
            parameter = new ReportParameter("District", entities[1]);
            report.SetParameters(parameter);
            parameter = new ReportParameter("Facility", entities[2]);
            report.SetParameters(parameter);
            #endregion

            #region Report Parameters
            DataTable dataTable = dataSet.Tables["ANC"];
            FillDonorReportParameters(report, dataTable);

            dataTable = dataSet.Tables["MAT"];
            FillDonorReportParameters(report, dataTable);

            dataTable = dataSet.Tables["MC"];
            FillDonorReportParameters(report, dataTable);
            #endregion
        }

        private static void FillDonorReportParameters(LocalReport report, DataTable dataTable)
        {
            ReportParameter parameter = null;
            List<string> missingParameters = GetDonorReportParameters(dataTable.TableName);
            foreach (DataRow row in dataTable.Rows)
            {
                string parameterName = row[0].ToString().Replace(" ", "");
                string value = row[1].ToString();
                parameter = new ReportParameter(parameterName, value);
                try
                {
                    report.SetParameters(parameter);
                }
                catch { }
                missingParameters.Remove(parameterName);
            }
            foreach (string m in missingParameters)
            {
                parameter = new ReportParameter(m, (0).ToString());
                report.SetParameters(parameter);
            }
        }

        private static List<string> GetDonorReportParameters(string reportName)
        {
            List<string> indicators = new List<string>();
            switch (reportName)
            {
                case "ANC":
                    string[] anc = { 
                                       "ANC01", "ANC02", "ANC03", "ANC05", "ANC06", "ANC08", "ANC09", 
                                       "ANC10", "ANC11", "ANC13", "ANC14"
                                   };
                    foreach (string i in anc) indicators.Add(i);
                    break;

                case "MAT":
                    string[] mat = { "MAT03", "MAT04", "MAT05", "MAT06", "MAT07", "MAT09", "MAT10", "MAT11" };
                    foreach (string i in mat) indicators.Add(i);
                    break;

                case "MC":
                    string[] mc = { "MC01", "MC02", "MC03", "MC08", "MC10", "MC11", "MC12", "MC14", "MC15", "MC18", "MC19" };
                    foreach (string i in mc) indicators.Add(i);
                    break;
            }
            return indicators;
        }

        private static void FillDonorReportPMTCTIndicatorTable(
            Reports.PMTCTIndicatorDataTable PMTCTIndicatorDataTable, DataSet datasource)
        {
            DataRowCollection ANC = datasource.Tables["ANC"].Rows;
            DataRowCollection MAT = datasource.Tables["MAT"].Rows;
            DataRowCollection PCR = datasource.Tables["PCR"].Rows;
            int anc01 = 0;
            try { anc01 = Int32.Parse(ANC[0][1].ToString()); }
            catch { };

            int anc02 = 0;
            try { anc02 = int.Parse(ANC[1][1].ToString()); }
            catch { };

            int anc04 = 0;
            try { anc04 = int.Parse(ANC[3][1].ToString()); }
            catch { };

            int anc05 = 0;
            try { anc05 = int.Parse(ANC[4][1].ToString()); }
            catch { };

            int anc08 = 0;
            try { anc08 = int.Parse(ANC[7][1].ToString()); }
            catch { };

            int anc07 = 0;
            try { anc07 = int.Parse(ANC[6][1].ToString()); }
            catch { };

            //int anc08 = int.Parse(ANC[8][1].ToString());
            //int anc09 = int.Parse(ANC[9][1].ToString());
            //int anc10 = int.Parse(ANC[10][1].ToString());
            //int anc11 = int.Parse(ANC[11][1].ToString());
            int anc13 = 0;
            try { anc13 = int.Parse(ANC[12][1].ToString()); }
            catch { };

            int anc14 = 0;
            try { anc14 = int.Parse(ANC[13][1].ToString()); }
            catch { };

            int pcr09 = 0;
            try { pcr09 = int.Parse(PCR[8][1].ToString()); }
            catch { };

            int pcr10 = 0;
            try { pcr10 = int.Parse(PCR[9][1].ToString()); }
            catch { };

            int pcr11 = 0;
            try { pcr11 = int.Parse(PCR[10][1].ToString()); }
            catch { };

            int mat01 = 0;
            try { mat01 = int.Parse(MAT[0][1].ToString()); }
            catch { };

            int mat03 = 0;
            try { mat03 = int.Parse(MAT[2][1].ToString()); }
            catch { };

            int mat04 = 0;
            try { mat04 = int.Parse(MAT[3][1].ToString()); }
            catch { };

            int mat05 = 0;
            try { mat05 = int.Parse(MAT[4][1].ToString()); }
            catch { };

            int mat06 = 0;
            try { mat06 = int.Parse(MAT[5][1].ToString()); }
            catch { };

            int mat07 = 0;
            try { mat07 = int.Parse(MAT[6][1].ToString()); }
            catch { };

            int mat09 = 0;
            try { mat09 = int.Parse(MAT[8][1].ToString()); }
            catch { };

            int mat10 = 0;
            try { mat10 = int.Parse(MAT[9][1].ToString()); }
            catch { };

            int mat12 = 0;
            try { mat12 = int.Parse(MAT[11][1].ToString()); }
            catch { };

            DataRow row = PMTCTIndicatorDataTable.NewRow();
            row[0] = 1;
            row[1] = "Total number of pregnant women (New clients)";
            row[2] = anc01;
            row[3] = mat01;
            //row[3] = mat04;
            row[4] = anc01 + mat01;
            PMTCTIndicatorDataTable.Rows.Add(row);

            row = PMTCTIndicatorDataTable.NewRow();
            row[0] = 2;
            row[1] = "Number of pregnant women who were counseled, tested and received results";
            row[2] = anc08;
            row[3] = mat05 + mat06;
            row[4] = anc08 + mat05 + mat06;
            PMTCTIndicatorDataTable.Rows.Add(row);

            row = PMTCTIndicatorDataTable.NewRow();
            row[0] = 3;
            row[1] = "Number of pregnant women with known HIV positive";
            row[2] = anc02;
            row[3] = mat03;
            row[4] = anc02 + mat03;
            PMTCTIndicatorDataTable.Rows.Add(row);

            row = PMTCTIndicatorDataTable.NewRow();
            row[0] = 4;
            row[1] = "Number of pregnant women tested HIV positive";
            row[2] = anc05 + anc07;
            row[3] = mat07;
            row[4] = anc05 + anc07 + mat07;
            PMTCTIndicatorDataTable.Rows.Add(row);

            row = PMTCTIndicatorDataTable.NewRow();
            row[0] = 5;
            row[1] = "Number of pregnant women tested HIV with their partners (couple counselling)";
            row[2] = anc13;
            row[3] = DBNull.Value;
            row[4] = anc13;
            PMTCTIndicatorDataTable.Rows.Add(row);

            row = PMTCTIndicatorDataTable.NewRow();
            row[0] = 6;
            row[1] = "Number of pregnant women and their partners with discordant results";
            row[2] = anc14;
            row[3] = DBNull.Value;
            row[4] = anc14;
            PMTCTIndicatorDataTable.Rows.Add(row);

            row = PMTCTIndicatorDataTable.NewRow();
            row[0] = 7;
            row[1] = "Number of pregnant HIV+ women receiving ARVs";
            row[2] = pcr09 + pcr10;
            row[3] = mat09 + mat10 + mat12;
            row[4] = pcr09 + pcr10 + mat09 + mat10 + mat12;
            PMTCTIndicatorDataTable.Rows.Add(row);

            row = PMTCTIndicatorDataTable.NewRow();
            row[0] = DBNull.Value;
            row[1] = "AZT prophylactic regimen";
            row[2] = pcr09;
            row[3] = DBNull.Value;
            row[4] = pcr09;
            PMTCTIndicatorDataTable.Rows.Add(row);

            row = PMTCTIndicatorDataTable.NewRow();
            row[0] = DBNull.Value;
            row[1] = "AZT + 3TC prophylaxis regimen";
            row[2] = DBNull.Value;
            row[3] = mat09;
            row[4] = mat09;
            PMTCTIndicatorDataTable.Rows.Add(row);

            row = PMTCTIndicatorDataTable.NewRow();
            row[0] = DBNull.Value;
            row[1] = "Multi-drug prophylactic regimen (NVP + AZT + 3TC)";
            row[2] = DBNull.Value;
            row[3] = mat10;
            row[4] = mat10;
            PMTCTIndicatorDataTable.Rows.Add(row);

            row = PMTCTIndicatorDataTable.NewRow();
            row[0] = DBNull.Value;
            row[1] = "ART";
            row[2] = pcr10 + pcr11;
            row[3] = mat12;
            row[4] = pcr10 + pcr11 + mat12;
            PMTCTIndicatorDataTable.Rows.Add(row);
        }

        private static void FillDonorReportHIVExposedIndicator(
            Reports.HIVExposedIndicatorDataTable HIVExposedIndicatorDataTable, DataSet datasource)
        {
            DataRowCollection MC = datasource.Tables["MC"].Rows;
            int mc01 = 0;
            try { mc01 = int.Parse(MC[0][1].ToString()); }
            catch { };

            int mc02 = 0;
            try { mc02 = int.Parse(MC[1][1].ToString()); }
            catch { };

            int mc03 = 0;
            try { mc03 = int.Parse(MC[2][1].ToString()); }
            catch { };

            int mc08 = 0;
            try { mc08 = int.Parse(MC[7][1].ToString()); }
            catch { };

            int mc09 = 0;
            try { mc09 = int.Parse(MC[8][1].ToString()); }
            catch { };

            int mc10 = 0;
            try { mc10 = int.Parse(MC[9][1].ToString()); }
            catch { };

            int mc11 = 0;
            try { mc11 = int.Parse(MC[10][1].ToString()); }
            catch { };

            int mc12 = 0;
            try { mc12 = int.Parse(MC[11][1].ToString()); }
            catch { };

            int mc13 = 0;
            try { mc13 = int.Parse(MC[12][1].ToString()); }
            catch { };

            int mc14 = 0;
            try { mc14 = int.Parse(MC[13][1].ToString()); }
            catch { };

            int mc15 = 0;
            try { mc15 = int.Parse(MC[14][1].ToString()); }
            catch { };

            int mc16 = 0;
            try { mc16 = int.Parse(MC[15][1].ToString()); }
            catch { };

            int mc18 = 0;
            try { mc18 = int.Parse(MC[17][1].ToString()); }
            catch { };

            int mc19 = 0;
            try { mc19 = int.Parse(MC[18][1].ToString()); }
            catch { };

            DataRow row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 1;
            row[1] = "Number of Exposed Infants";
            row[2] = mc01;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            #if OLD_RULES_AND_CODES
            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 2;
            row[1] = "Number of infants born to HIV-infected women using Niverapine";
            row[2] = mc02 + mc03;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 3;
            row[1] = "Number of infants born to HIV-infected women started on contrimoxazole within 2 months of birth";
            row[2] = mc08;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 4;
            row[1] = "Total number of infants born to HIV-infected women who received an HIV test by DNA-PCR (1st test and 2nd test)/antibody";
            row[2] = mc10 + mc14;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 5;
            row[1] = "Number of infants who received PCR testing less than 2 months";
            row[2] = mc12;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 6;
            row[1] = "Total number of infants tested HIV positive by DNA-PCR (1st test and 2nd test)/antibody";
            //row[2] = mc11 + mc15 + mc18;
            row[2] = mc11 + mc15;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 7;
            row[1] = "Total number of children enrolled at CTC";
            row[2] = mc19;
            HIVExposedIndicatorDataTable.Rows.Add(row);
#else
            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 2;
            row[1] = "Number of infants initiated NVP during birth";
            row[2] = mc02;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 3;
            row[1] = "Number of infants initiated NVP for the first time at RCH";
            row[2] = mc03;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 4;
            row[1] = "Number of infants born to HIV infected women started on contrimoxazole within 2 months of birth";
            row[2] = mc09;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 5;
            row[1] = "Number of infants tested for DNA-PCR for the first test";
            row[2] = mc10;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 6;
            row[1] = "Number of infants tested for Antibody or DNA-PCR for second test";
            row[2] = mc14;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 7;
            row[1] = "Number of infants identified HIV positive (1st and 2nd test)";
            row[2] = mc11 + mc15;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 8;
            row[1] = "Number of infants tested for DNA-PCR within 2 month of age";
            row[2] = mc12;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 9;
            row[1] = "Number of infants identified to be HIV positive using DNA-PCR within 2 month of age";
            row[2] = mc13;
            HIVExposedIndicatorDataTable.Rows.Add(row);

            row = HIVExposedIndicatorDataTable.NewRow();
            row[0] = 10;
            row[1] = "Number of infants enrolled at CTC";
            row[2] = mc19;
            HIVExposedIndicatorDataTable.Rows.Add(row);
#endif
        }
        #endregion
    }

    /// <summary>
    /// Different type of reports that can be generated
    /// </summary>
    public enum ReportTypes
    {
        /// <summary>
        /// Monthly Summary Form
        /// </summary>
        MONTHLY_SUMMARY_FORM = 1,

        /// <summary>
        /// Donor Report
        /// </summary>
        DONOR_REPORT = 2
    }
}
